library(brms)
library(dplyr)
library(ggplot2)
library(ggthemes)
library(kfigr)
library(knitr)
library(patchwork)

The data set was read in as is, the columns subj, arm, cond, series and no were converted to factors, the column filename was deleted. A new column was added to the dataset, patient, based on the subj prefix (‘P’ or ‘S’), with a ‘0’ coding for healthy controls, and a ‘1’ for patients.

read.csv("features.csv") %>%
  mutate(filename = NULL,
         patient = factor(if_else(grepl("^P", 
                                        subj), 
                                  1L, 
                                  0L)),
         series = factor(series),
         subj = factor(subj),
         arm = factor(arm),
         cond = factor(cond),
         no = factor(no)) ->
  drum_beats

1 Exploration

1.1 Instruction Condition, and Arm Used

In a first attempt to get an overview, the descriptors’ density estimates were plotted, broken down by arm and cond.

dep_vars <- names(drum_beats)[which(!(names(drum_beats) %in% c("subj", 
                                                               "arm", 
                                                               "cond", 
                                                               "no",
                                                               "series",
                                                               "patient")))]
n_vars <- length(dep_vars)
  plot_lst <- vector("list", length = n_vars)
  plt_cnt <- 1
  for (dv in dep_vars) {
    if (plt_cnt == n_vars) {
      plt_pos <- c(2, 0.5)
    } else {
      plt_pos <- "none"
    }
    if (plt_cnt %% 4 == 1) {
      ylab <- "density"
    } else {
      ylab <- ""
    }
    plot_lst[[plt_cnt]] <- ggplot(drum_beats, 
                                  aes_string(x = dv, 
                                             color = "cond")) +
      geom_density(na.rm = TRUE) + 
      scale_color_colorblind() +
      ylab(ylab) +
      geom_rug(alpha = 0.25) + 
      theme(legend.position = plt_pos) +
      facet_wrap(~ arm)
    plt_cnt <- plt_cnt + 1
  }
  print(wrap_plots(plot_lst, 
                   ncol = 4) +
          plot_annotation(
            tag_levels = "A"))

Fig. 1. Descriptor densities along with raw data points (rug ticks on x axes), broken down by arm (dominant [D] vs non-dominant [ND]) and instruction condition (controlled = C, normal = N).


Several peculiarities are immediately apparent from the plots in Fig. 1:

  • There are no substantial differences in the density distributions between normal (N) and controlled (C) strokes
  • attDur, LAT, and attFlat have very few unique data values (see rug ticks at bottom of plots)
  • Looking at the dominant arm alone (and excluding the vars attDur, LAT, and attFlat for the reason just mentioned), the densities have a trend toward a larger variance in the controlled condition (in other words: a less pointed distribution) with additional or larger humps in the tails, respectively

The lack of any clear-cut differences in the raw data between conditions suggests that it will be hard to find any differences by modeling.

The limited number of unique values in the attack-related measures (e.g. attDur only has 35 unique values in a total of 1102 observations across all subjects, conditions, and sides; that’s only 3 percent!) suggests that rounding errors propagated through the calculations. This is probably due to very similar, i.e. highly automated, and short attack times combined with the given sampling frequency, resulting in few data points, which in course of the calculations result in the observed phenomenon. But I’m just guessing here, as I do not know anything about these descriptors and how they are calculated or interpreted. Judging by the range of values of, i.e., attDur (2.59, 9.8ms, across both sides and conditions) and a sampling frequency of 48 kHz, this leaves us at 48 * (9.8 - 2.59) = 346 points to choose beginning and end of the attack. Given the supposed highly automatized motor program used to initiate the stroke, along with the laws of physics at play here (no pun intended), it is not very surprising to see very few unique values. My limited knowledge—or rather, my ignorance of anything sound-related—aside, from a statistical standpoint these measures do not seem suited to describe any differences between the experimental conditions investigated here.

Given the very few data points in the attack phase, any descriptor derived from such a short period of time (.e.g.. attSPL) cannot be judged as being stable in the sense of being reproducible. Hence I suggest to drop all attack-derived descriptors.

# drum_beats %>%
#   mutate(attDur = NULL,
#          LAT = NULL,
#          attSPL = NULL,
#          attSC = NULL,
#          attFlat = NULL,
#          attSpecFlat = NULL) ->
#   drum_beats

The increase in variance for the conditions N < C does not come as a surprise as I assume normal also means highly trained and thus automatized, whereas controlled involves less automatization and more ‘individualness’ both within and between subjects.

1.1.1 Conclusions

Looking at the above investigated descriptors and Danielsen et al. (2015), it seems reasonable to limit the modeling attempts to totDur, totSPL, totSC, and TC.

But Sofia wrote on 2020-07-09: “Francesco and I have discussed a bit related to descriptors and we want to concentrate on the “transient” period (although the name probably will change). Spectral Centroid (transSC) should be one, and I suggest transFlat for the other. Francesco, does that sound reasonable?"

On 2020-07-22 both Sofia and Francesco agreed upon transSC, transFlat, and transCrest as the probably most important response variables to look at.

1.1.2 Francesco’s comments

Update:

  • The lack of data points for attFlat is fixed by solving a bug in the feature extraction: now the downsampling ratio for the envelope extraction is reduced, and makes the MIRToolbox algorithm less sensitive to frames with an rms value of 0 (which returns an incorrect value of 0, since we have a geometric mean at the numerator). Now we have a larger spread which allows high values (1 = peaky envelope, 0 = smooth/flat envelope).
  • The crest factor is now calculated for the separate phases.

Regarding the attack phase: I agree with the remarks regarding duration. Given the fact that we are not comparing different instruments, I wouldn’t have expected a large variation. This is not surprising if we consider that our system is changing only slightly (same rototom, same drumstick, same action, a bit different tuning across subjects): in fact, the perceived timbral differences are so small that we are in trouble guessing on the descriptors.

The sampling frequency is even lower (\(f_s = 44100\) Hz). Even if we had a higher sample rate which could reveal some discrepancies in the attack durations, we would have to prove that they are perceptually relevant.

Therefore, I am happy to discard attDur and LAT (which is obviously a log-transformed duration, only there for the sake of consistency with the literature).

I am a bit more in doubt when it comes to discarding all the attack descriptors. Even if what Michael says is true from a statistical point of view, we should still be able to discriminate timbre on short time windows due to the high temporal resolution of our hearing. Attack phase descriptors (with the same definition of attack that we are using, which is most likely not coincident with perceptual attack) are employed in Câmara et al. (2020), and the Oslo group has a paper under construction which analyzes drum sounds in a similar manner (see OsloPlots.png in the OneDrive folder).

I am worried that merely taking the overall descriptors into account would introduce a lot of unnecessary and perceptually catching information — mostly the tonal part of the signal, i.e. the drum ringing in the last part of the decay. That’s why Sofia and I are suggesting to look at what we could call “main energy” or “early decay” phase (i.e. from max peak to temporal centroid).

Would it be feasible to set up 4 different models (i.e. one for each phase), at least in the univariate version?

As for the descriptors to include: although TC is employed in Danielsen et al. (2015), the PDFs are even more similar. I would go for Dur (except attack?), SPL, SC, and one between Flat, SpecFlat or Crest.

My (informal and biased) listening tests tell me that, at least for some subjects, I hear a pattern going towards a harsher (controlled) vs smoother (normal) timbre exactly at the hit point, plus slightly less (controlled) or more pitch/amplitude fluctuation. Hopefully this could be catched by spectral centroid, specrtral/temporal flatness, or crest factor. This should be independent of SPL unless the subject misinterpreted the instructions, therefore SPL acts as a sort of control variable in our model.

1.1.3 Model Considerations

There are several points that need to be considered before making a decision regarding the type of modeling to be done in this study, (1) the sample size places restrictions on the external validity; (2) data from small samples can be better modeled when regularization is in place to ‘tame’ the estimates; (3) the hierarchical structure of the data (subjects played several trials with either their dominant or non-dominant arm under two conditions) suggests a multilevel analysis of the data which would, in addition to the Bayesian regularization via priors, also results in shrinkage of the estimates; (4) given the small distribution differences between the two experimental conditions, along with the

  1. Given the extremely small sample size, any attempt to fit the data using traditional statistics, a.k.a. null-hypothesis significance testing, would make us vulnerable to all kinds of criticism. I therefore suggest to use Bayesian statistics instead, as it allows us to estimate probability distributions of parameters rather than confidence intervals around point estimates, and thus embraces uncertainty in estimates.
  2. Additionally, Bayesian regression uses prior probability distributions to arrive at sensible estimates. These priors regularize estimates, or draw them toward zero, a desirable effect which has long been recognized even in traditional statistics (e.g. ridge regression and lasso; Tibshirani (1996)).
  3. ANOVA (or regression with grouping variables) requires each subject’s trials to be averaged, say, within conditions or groups (or both), to be able to assess treatment effects; this results in the individual variation within a subject to get lost while it might have been very informative to include it in the analysis. Multilevel (or hierarchical) modeling allows to include the entire data structure (Fig. 2) so that no information gets lost through averaging, but all variation (both individual and treatment-driven) propagates through the analysis and ends up in the final results, allowing for more realistic credibility margins around estimates.
  4. Variance in traditional statistics is considered to be fixed (think homoscedasticity in ANOVA, or the \(\epsilon\) in regression formulas such as \(y_i = \beta_0 + \beta_1x_i + \epsilon\)), whereas it is an estimated quantity in Bayesian statistics and therefore can vary between conditions (or groups or subjects etc.) and thus capture varying variance in different conditions, or groups etc.

# chunk intentionally empty  
Group:                    Patient                       Healthy Control
                        /        \                     /               \
Instruction:    Normal                  Controlled   Normal                     Controlled
                | |    \                / |    \
Player:         1 2 ... n              1  2 ... n
               / \
Side   dominant non-dominant
        / | \       / | \
Trial  1 ..  p     1  .. p

Fig. 2. The multilevel structure of a data set should be reflected in the analysis.


1.1.4 Conclusions

Will start with a simple univariate model, add predictors and interactions, then a bivariate model, and finally a quadruple-variate model and see where this leads us.

1.2 Individual Responses

The humps in the density distributions in section Instruction Condition, and Arm Used made me curious where they might originate from. So in the following graph the density estimates of one of the descriptors, transSC, are plotted broken down by subj. and then also by cond, separately for patients and healthy subjects.

ggplot(drum_beats, aes(transSC, 
                       color = subj, 
                       linetype = cond)) + 
  geom_density(alpha = 0.1) 

Fig. 3. transSC density distribution of participants, broken down by instruction condition.


It is obvious that some participants do not differ substantially between the normal and the controlled condition, whereas others do, and even markedly so. Additionally, there seems to be quite a spread of the centers of distributions across a wide range of values, suggesting very individual drum sounds.

The wide distribution of centers of mass between individuals made me want to further break down the plot.

ggplot(drum_beats, aes(transSC, 
                       color = subj, 
                       linetype = cond)) + 
  geom_density(alpha = 0.1) +
  facet_wrap(~ patient)

Fig. 4. transSC density distribution of participants, broken down by instruction condition and group (patients and healthy subjects).


The above plot is interesting in that it seems to show that the four healthy subjects were more uniform than the patients in their transSC distributions and also, with the exception of S2, had very similar transSC distributions for the normal and the controlled conditions. In the patients, two had very similar distributions in both conditions (P1 and P5), whereas the two others showed differing results for the two conditions. So with regard to Sofia’s hypothesis (ch. Modeling) I’d argue, at least for transSC alone, having drummers play normal and controlled strokes would not allow subjects to tell the difference in a listening test. But maybe it would qualify as a screening test for movement disorders in drummers. Just a random thought.

While breaking it down it occurred to me that looking at individual variation (that is, between series) might also be enlightening.

ggplot(drum_beats, aes(transSC, 
                       color = cond, 
                       group = series)) + 
  geom_density(alpha = 0.1) +
  facet_wrap(~ subj, nrow = 2)

Fig. 5. Density plots of individual series.


And it was! The plot in Fig. 5 made visible that P1 and P5 had consistently very low transSC values. P3 was consistent within the normal instruction condition, but had, on average, higher values, and with a lot more variation, in the controlled condition. P4 had more variation in both conditions, and higher transSC values in both; in other words, P4 was consistantly bad. (But then again: what do I know what bad is wrt transSC!)

The healthy subjects showed comparable variation and centers of mass within conditions, and all but one (S2) also across conditions.

Comparing the two rows of panels in Fig. 5 reveals that healthy subjects have more variation than the patients.

Although tempting, we probably shouldn’t get carried away and generalize to the populations of healthy drummers and ones with movement disorders, respectively.

2 Modeling

Sofia, on 2020-07-07: “The main hypothesis is that playing instruction (N/C) will affect the stroke in a way that is perceivable”.

2.1 Univariate Models

Looking at the variables agreed upon I have decided to use as response variables in the regression models—implying that this is by no means set in stone—, it seems like a skewed normal link function would be appropriate to model them.

Let’s start with transSCtotDur. Using an extended model description language (Bates 2010; Bürkner 2018), going back to Wilkinson and Rogers’s (1973) modeling language, we write:

(m0_form <-bf(transSC ~ 1 + (1 | subj)))
transSC ~ 1 + (1 | subj) 

which claims that transSC is explained by (‘~’) an intercept, denoted by ‘1’, and an additional term ‘(1 | subj)’. The ‘1’ in parentheses again stands for the intercept, but the pipe ‘|’ assigns an intercept to each level of the factor ‘subj’. In this particular case this means that the model will estimate an individual intercept for each unique drummer listed in the data set column subj. These individual, or varying, intercepts are then used in informing the estimation of the population intercept.

Note: set MODEL to TRUE at the top of the script if you haven’t compile/build your model yet.

if (MODEL) {
  m0 <- brm(m0_form,
            family = skew_normal(),
            inits = "0",
            data = drum_beats)
  m0 <- add_criterion(m0, 
                      "loo",
                      reloo = TRUE)
  save(m0, 
       file = "m0.rda")
} else {
  load("m0.rda")
}

This null model is also termed unconditional model because it has no grouping structure apart from individuals–the ‘subj’ bit in the model equation above. There is some variation in every natural data set. To make sure, it’s not just variation caused by different participants, we can calculate the intra-class correlation coefficient (ICC).

m0_icc <- ICC(m0, "subj")

The Null model’s ICC amounts to 0.75, which suggests that approx. 75 percent of the variation in the data set can be attributed to (or explained by) the grouping structure. This is highly unfortunate, as it does not leave a lot of variation to be explained by independent factors like instruction, or arm. The most likely reason for this high ICC value is the small sample size combined with high inter-individual variation. Small sample sizes combined with large trial numbers are less of a problem when subjects respond, on average, close to the population mean, even with large spread due to fluctuating alertness, increasing fatigue etc., .e.g. in reaction time paradigms. But here, with large intra- and inter-individual variation, this might become a problem.


Tab. 1. Model summary.

(m0_summary <- summary(m0, 
                       priors = TRUE))
 Family: skew_normal 
  Links: mu = identity; sigma = identity; alpha = identity 
Formula: transSC ~ 1 + (1 | subj) 
   Data: drum_beats (Number of observations: 1102) 
Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
         total post-warmup samples = 4000

Priors: 
alpha ~ normal(0, 4)
Intercept ~ student_t(3, 735, 136.5)
sd ~ student_t(3, 0, 136.5)
sigma ~ student_t(3, 0, 136.5)

Group-Level Effects: 
~subj (Number of levels: 8) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)   113.85     32.64    67.86   191.10 1.01      649     1076

Population-Level Effects: 
          Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept   750.12     37.86   679.46   829.76 1.01      754     1114

Family Specific Parameters: 
      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma    64.96      1.51    62.18    68.05 1.00     1862     1835
alpha     3.14      0.33     2.51     3.83 1.00     2013     1737

Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).

The intercept in Tab. 1 amounts to roughly 750. In this model specification, the intercept is identical to the data set average. The table also shows that the inter-individual standard deviation (sd(Intercept)) is large compared to the unexplained variation (sigma). This led to the large ICC value above. By adding more and more independent factors to the model specification, we will later try to decrease \(\sigma\), i.e. ‘explain away’ as much remaining variation as possible.

pp_check(m0, nsamples = 100)

Fig. 6. Posterior predictive check. The thick blue line shows the distribution of the empirical data. The thin blue lines are one-hundred realizations of data generated from parameters estimated by the model.


The posterior predictive plot in Fig. 6 gives an impression on how the null model would generate data, given the parameters it estimated from the empirical data. As the thick line deviates from the modeled thin lines, especially on the left and the right side of the peak of the distribution, it is apparent that the model can be improved.

# conditional_effects(m0) 

2.1.1 Group Model

In this model, the intercept is complemented with second ‘main’ or population effect, the grouping variable patient:

(m1_form <- bf(transSC ~ 1 + patient + 
                (1 | subj)))
transSC ~ 1 + patient + (1 | subj) 

I could have also specified the model without the explicit ‘1 +’, as the intercept is implicitly included in the model unless I explicitly exclude it. From now on I will always save some extra typing by refraining from explicitly indluding the intercept in models.

So now the model not only contains the individuals as grouping structure to ‘explain away’ variation, but also whether they belong to the patients or the healthy subjects.

The prior distributions in Bayesian models reflect the knowledge about the estimated parameters. The package brms automatically places weakly informative priors on parameters as soft contraints. But with more complex models involving varying parameter estimates, the statistical back end which does the heavy lifting, needs stronger priors particularly on these parameters, otherwise models don’t converge. The parameters most vulnerable to outliers in the data are the varying effects parameters, or random effects in traditional statistics. Therefore we place a stronger prior probability distribution over the estimate of the SD of individual intercepts:

(m1_prior <- set_prior("normal(0, 10)", class = "sd"))
sd ~ normal(0, 10)

and leave the rest of the priors as suggested by the package brms (see Tab. 2 for their priors).

if (MODEL) {
  m1 <- brm(m1_form,
            prior = m1_prior,
            inits = "0",
            family = skew_normal(),
            data = drum_beats)
  m1 <- add_criterion(m1, 
                      "loo",
                      reloo = TRUE)
  save(m1, 
       file = "m1.rda")
} else {
  load("m1.rda")
}

Tab. 2. Model summary.

(m1_summary <- summary(m1, 
                       priors = TRUE))
 Family: skew_normal 
  Links: mu = identity; sigma = identity; alpha = identity 
Formula: transSC ~ 1 + patient + (1 | subj) 
   Data: drum_beats (Number of observations: 1102) 
Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
         total post-warmup samples = 4000

Priors: 
alpha ~ normal(0, 4)
Intercept ~ student_t(3, 735, 136.5)
sd ~ normal(0, 10)
sigma ~ student_t(3, 0, 136.5)

Group-Level Effects: 
~subj (Number of levels: 8) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)    49.15      4.79    40.35    58.93 1.00     1884     2233

Population-Level Effects: 
          Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept   762.94     24.83   713.98   810.08 1.00     1417     1751
patient1    -26.51     34.40   -93.82    41.08 1.00     1611     1875

Family Specific Parameters: 
      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma    65.12      1.57    62.09    68.18 1.00     2734     2436
alpha     3.26      0.35     2.63     3.98 1.00     3064     2748

Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).

The intercept in Tab. 2 amounts to roughly 763. In this model specification, the intercept is identical to the controlled strokes, while the patient1 value is the mean of the posterior distribution difference between the healthy subjects and the patients (-27). The table also shows that the interindividual standard deviation (sd(Intercept) \(\approx\) 49 is still large compared to the unexplained variation (sigma \(\approx\) 65).

pp_check(m1, nsamples = 100)

Fig. 7. Posterior predictive check. The thick blue line shows the distribution of the empirical data. The thin blue lines are one-hundred realizations of data generated from parameters estimated by the model.


The posterior predictive plot in Fig. 7 gives an impression on how this model would generate data, given the parameters it estimated from the empirical data. There is not much change from Fig. 6, which is not very surprising given the small estimated difference between the groups.

conditional_effects(m1,
                    dpar = "mu")

2.1.2 Group + Condition Model

In this model, the intercept is complemented with second ‘main’ or population effect, the instruction condition cond:

(m2_form <-bf(transSC ~ patient + cond + 
                (1 | subj)))
transSC ~ patient + cond + (1 | subj) 

So now the model also contains the individuals as grouping structure to ‘explain away’ variation, but also the manipulations.

The prior distributions in Bayesian models reflect the knowledge about the estimated parameters. The package brms automatically places weakly informative priors on parameters as soft contraints. But with more complex models involving varying parameter estimates, the statistical back end which does the heavy lifting, needs stronger priors particularly on these parameters, otherwise models don’t converge. The parameters most vulnerable to outliers in the data are the varying effects parameters, or random effects in traditional statistics. Therefore we place a stronger prior probability distribution over the estimate of the SD of individual intercepts:

(m2_prior <- c(set_prior("normal(0, 3)",   class = "sd"),
               set_prior("normal(0, 3)",   class = "sigma"),
               set_prior("normal(0, 2)",   class = "alpha")))
        prior class coef group resp dpar nlpar bound source
 normal(0, 3)    sd                                    user
 normal(0, 3) sigma                                    user
 normal(0, 2) alpha                                    user

and leave the rest of the priors as suggested by the package brms (see Tab. 3 for their priors).

if (MODEL) {
  m2 <- brm(m2_form,
            prior = m2_prior,
            family = skew_normal(),
            inits = "0",
            data = drum_beats)
  m2 <- add_criterion(m2, 
                      "loo",
                      reloo = TRUE)
  save(m2, 
       file = "m2.rda")
} else {
  load("m2.rda")
}

Tab. 3. Model summary.

(m2_summary <- summary(m2, 
                       priors = TRUE))
 Family: skew_normal 
  Links: mu = identity; sigma = identity; alpha = identity 
Formula: transSC ~ patient + cond + (1 | subj) 
   Data: drum_beats (Number of observations: 1102) 
Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
         total post-warmup samples = 4000

Priors: 
alpha ~ normal(0, 2)
Intercept ~ student_t(3, 735, 136.5)
sd ~ normal(0, 3)
sigma ~ normal(0, 3)

Group-Level Effects: 
~subj (Number of levels: 8) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)    29.32      1.53    26.42    32.31 1.00     2957     2716

Population-Level Effects: 
          Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept   779.75     14.93   750.33   808.62 1.00     1456     1834
patient1    -27.61     20.71   -67.51    13.79 1.00     1420     2031
condN       -41.21      3.40   -48.01   -34.42 1.00     4440     2939

Family Specific Parameters: 
      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma    52.38      0.93    50.61    54.28 1.00     4468     2827
alpha     1.80      0.23     1.36     2.27 1.00     4016     2679

Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).

The intercept in Tab. 3 amounts to roughly 780. In this model specification, the intercept is identical to the controlled strokes, while the condN value is the mean of the posterior distribution difference between controlled and normal strokes (-41). The table also shows that the interindividual standard deviation (sd(Intercept) \(\approx\) 29 is still large compared to the unexplained variation (sigma \(\approx\) 52).

pp_check(m2, nsamples = 100)

Fig. 8. Posterior predictive check. The thick blue line shows the distribution of the empirical data. The thin blue lines are one-hundred realizations of data generated from parameters estimated by the model.


The posterior predictive plot in Fig. 8 gives an impression on how this model would generate data, given the parameters it estimated from the empirical data. There is not much change from Fig. 6, which is not very surprising given the small estimated difference between the conditions.

conditional_effects(m2,
                    dpar = "mu")

2.1.3 Group + ConditionVI Model

The last model included the instruction condition, more realistically reflecting the true structure of the data set. But it did not acknowledge that each subject executed several strokes in each of these conditions. This model includes a term with a varying intercept (VI) for condition to reflect just that, which will also assist in more realistically estimate the population effect of cond:

(m3_form <- bf(transSC ~ patient + cond + 
                 (1 | subj) + 
                 (1 | cond)))
transSC ~ patient + cond + (1 | subj) + (1 | cond) 

Including more varying parameters in the model requires the prior on them to be even stronger:

(m3_prior <- m2_prior)
        prior class coef group resp dpar nlpar bound source
 normal(0, 3)    sd                                    user
 normal(0, 3) sigma                                    user
 normal(0, 2) alpha                                    user
if (MODEL) {
  m3 <- brm(m3_form,
            prior = m3_prior,
            family = skew_normal(),
            inits = "0",
            data = drum_beats)
  m3 <- add_criterion(m3, 
                      "loo",
                      reloo = TRUE)
  save(m3, 
       file = "m3.rda")
} else {
  load("m3.rda")
}

Tab. 4. Model summary.

(m3_summary <- summary(m3, 
                       priors = TRUE))
 Family: skew_normal 
  Links: mu = identity; sigma = identity; alpha = identity 
Formula: transSC ~ patient + cond + (1 | subj) + (1 | cond) 
   Data: drum_beats (Number of observations: 1102) 
Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
         total post-warmup samples = 4000

Priors: 
alpha ~ normal(0, 2)
Intercept ~ student_t(3, 735, 136.5)
sd ~ normal(0, 3)
sigma ~ normal(0, 3)

Group-Level Effects: 
~cond (Number of levels: 2) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     2.40      1.81     0.11     6.78 1.00     2782     2302

~subj (Number of levels: 8) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)    29.29      1.52    26.49    32.40 1.00     2958     2312

Population-Level Effects: 
          Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept   780.37     14.81   751.07   810.05 1.00     1760     1980
patient1    -27.47     20.03   -66.99    11.40 1.00     1867     2420
condN       -41.22      5.45   -52.17   -29.71 1.00     2758     2272

Family Specific Parameters: 
      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma    52.38      0.93    50.58    54.18 1.00     4750     3046
alpha     1.80      0.23     1.35     2.26 1.00     4524     3358

Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).

The intercept in Tab. 4 amounts to roughly 780. In this model specification, the intercept is identical to the controlled strokes, while the condN value is the mean of the posterior distribution difference between controlled and normal strokes (-41). The table also shows that the inter-individual standard deviation (sd(Intercept) \(\approx\) 29 is not large anymore compared to the unexplained variation (sigma \(\approx\) 52).

pp_check(m3, nsamples = 100)

Fig. 9. Posterior predictive check. The thick blue line shows the distribution of the empirical data. The thin blue lines are one-hundred realizations of data generated from parameters estimated by the model.


The posterior predictive plot in Fig. 9 gives an impression on how this model would generate data, given the parameters it estimated from the empirical data. There is not much change from Fig. 6, which is not very surprising given the small estimated difference between the conditions.

conditional_effects(m3,
                    dpar = "mu")

2.1.4 Group x ConditionVI

The last model included the instruction condition, more realistically reflecting the true structure of the data set. But it did not acknowledge that each subject executed several strokes in each of these conditions. This model includes a term with a varying intercept (VI) for condition to reflect just that, which will also assist in more realistically estimate the population effect of cond:

(m4_form <- bf(transSC ~ patient * cond + 
                 (1 | subj) + 
                 (1 | cond)))
transSC ~ patient * cond + (1 | subj) + (1 | cond) 

Including more varying parameters in the model requires the prior on them to be even stronger:

(m4_prior <- m3_prior)
        prior class coef group resp dpar nlpar bound source
 normal(0, 3)    sd                                    user
 normal(0, 3) sigma                                    user
 normal(0, 2) alpha                                    user
if (MODEL) {
  m4 <- brm(m4_form,
            prior = m4_prior,
            family = skew_normal(),
            inits = "0",
            data = drum_beats)
  m4 <- add_criterion(m4, 
                      "loo",
                      reloo = TRUE)
  save(m4, 
       file = "m4.rda")
} else {
  load("m4.rda")
}

Tab. 5. Model summary.

(m4_summary <- summary(m4, 
                       priors = TRUE))
 Family: skew_normal 
  Links: mu = identity; sigma = identity; alpha = identity 
Formula: transSC ~ patient * cond + (1 | subj) + (1 | cond) 
   Data: drum_beats (Number of observations: 1102) 
Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
         total post-warmup samples = 4000

Priors: 
alpha ~ normal(0, 2)
Intercept ~ student_t(3, 735, 136.5)
sd ~ normal(0, 3)
sigma ~ normal(0, 3)

Group-Level Effects: 
~cond (Number of levels: 2) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     2.42      1.85     0.08     6.94 1.00     2417     1562

~subj (Number of levels: 8) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)    29.28      1.50    26.48    32.32 1.00     3031     2855

Population-Level Effects: 
               Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept        780.54     15.59   749.90   811.04 1.00     1591     1940
patient1         -28.57     21.59   -70.62    14.01 1.00     1777     2195
condN            -42.48      6.09   -54.51   -30.22 1.00     2734     2404
patient1:condN     2.43      6.30   -10.08    14.50 1.00     3836     3084

Family Specific Parameters: 
      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma    52.38      0.93    50.58    54.23 1.00     4832     2661
alpha     1.81      0.23     1.38     2.27 1.00     4316     2874

Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).

The intercept in Tab. 5 amounts to roughly 781. In this model specification, the intercept is identical to the controlled strokes, while the condN value is the mean of the posterior distribution difference between controlled and normal strokes (-42). The table also shows that the inter-individual standard deviation (sd(Intercept) \(\approx\) 29 is not large anymore compared to the unexplained variation (sigma \(\approx\) 52).

pp_check(m4, nsamples = 100)

Fig. 10. Posterior predictive check. The thick blue line shows the distribution of the empirical data. The thin blue lines are one-hundred realizations of data generated from parameters estimated by the model.


The posterior predictive plot in Fig. 10 gives an impression on how this model would generate data, given the parameters it estimated from the empirical data. There is not much change from Fig. 6, which is not very surprising given the small estimated difference between the conditions.

conditional_effects(m4,
                    dpar = "mu")

2.1.5 Group x ConditionVI + Arm Model

(m5_form <- bf(transSC ~ patient * cond + arm +
                 (1 | subj) + 
                 (1 | cond)))
transSC ~ patient * cond + arm + (1 | subj) + (1 | cond) 
(m5_prior <- m4_prior)
        prior class coef group resp dpar nlpar bound source
 normal(0, 3)    sd                                    user
 normal(0, 3) sigma                                    user
 normal(0, 2) alpha                                    user
if (MODEL) {
  m5 <- brm(m5_form,
            prior = m5_prior,
            family = skew_normal(),
            inits = "0",
            data = drum_beats)
  m5 <- add_criterion(m5, 
                      "loo",
                      reloo = TRUE)
  save(m5, 
       file = "m5.rda")
} else {
  load("m5.rda")
}

Tab. 6. Model summary.

(m5_summary <- summary(m5, 
                       priors = TRUE))
 Family: skew_normal 
  Links: mu = identity; sigma = identity; alpha = identity 
Formula: transSC ~ patient * cond + arm + (1 | subj) + (1 | cond) 
   Data: drum_beats (Number of observations: 1102) 
Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
         total post-warmup samples = 4000

Priors: 
alpha ~ normal(0, 2)
Intercept ~ student_t(3, 735, 136.5)
sd ~ normal(0, 3)
sigma ~ normal(0, 3)

Group-Level Effects: 
~cond (Number of levels: 2) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     2.42      1.78     0.11     6.65 1.00     2735     1793

~subj (Number of levels: 8) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)    29.31      1.55    26.39    32.46 1.00     3100     2530

Population-Level Effects: 
               Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept        780.33     14.76   750.33   808.40 1.00     1314     2017
patient1         -28.56     20.76   -68.90    11.88 1.00     1732     2200
condN            -42.44      6.37   -55.14   -30.14 1.00     2926     2260
armND              1.93      3.01    -4.01     7.76 1.00     5235     3127
patient1:condN     2.45      6.33    -9.85    15.02 1.00     3965     2984

Family Specific Parameters: 
      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma    52.41      0.93    50.62    54.27 1.00     5048     3105
alpha     1.81      0.23     1.38     2.27 1.00     4498     2708

Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).

In the Population-Level Effects section of Tab. 6 are now two estimates for the skewness parameter alpha (one for the controlled [alpha_Intercept] and one for the normal condition [alpha_condN]), while there is no entry for alpha in the Family Specific section anymore. All this due to our explicit modeling of alpha conditional on instruction condition.

pp_check(m5, nsamples = 100)

Fig. 11. Posterior predictive check. The thick blue line shows the distribution of the empirical data. The thin blue lines are one-hundred realizations of data generated from parameters estimated by the model.


conditional_effects(m5,
                    dpar = "mu")

2.1.6 Group x Condition + ArmVI Model

(m6_form <-bf(transSC ~ patient * cond + arm +
                (1 | subj) + 
                (1 | cond) + 
                (1 | arm)))
transSC ~ patient * cond + arm + (1 | subj) + (1 | cond) + (1 | arm) 
(m6_prior <- m5_prior)
        prior class coef group resp dpar nlpar bound source
 normal(0, 3)    sd                                    user
 normal(0, 3) sigma                                    user
 normal(0, 2) alpha                                    user
if (MODEL) {
  m6 <- brm(m6_form,
            prior = m6_prior,
            family = skew_normal(),
            inits = "0",
            data = drum_beats)
  m6 <- add_criterion(m6, 
                      "loo",
                      reloo = TRUE)
  save(m6, 
       file = "m6.rda")
} else {
  load("m6.rda")
}

Tab. 7. Model summary.

(m6_summary <- summary(m6, 
                       priors = TRUE))
 Family: skew_normal 
  Links: mu = identity; sigma = identity; alpha = identity 
Formula: transSC ~ patient * cond + arm + (1 | subj) + (1 | cond) + (1 | arm) 
   Data: drum_beats (Number of observations: 1102) 
Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
         total post-warmup samples = 4000

Priors: 
alpha ~ normal(0, 2)
Intercept ~ student_t(3, 735, 136.5)
sd ~ normal(0, 3)
sigma ~ normal(0, 3)

Group-Level Effects: 
~arm (Number of levels: 2) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     2.39      1.79     0.10     6.65 1.00     2325     1465

~cond (Number of levels: 2) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     2.42      1.77     0.13     6.66 1.00     2782     1894

~subj (Number of levels: 8) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)    29.28      1.50    26.45    32.25 1.00     3198     2601

Population-Level Effects: 
               Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept        779.39     15.27   750.06   809.27 1.00     1647     2176
patient1         -28.08     21.18   -70.55    14.96 1.01     1610     1999
condN            -42.47      6.26   -54.92   -29.72 1.00     2727     2477
armND              1.94      5.07    -8.39    12.18 1.00     2638     1969
patient1:condN     2.31      6.44   -10.59    15.07 1.00     4097     2793

Family Specific Parameters: 
      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma    52.36      0.92    50.58    54.23 1.00     5449     3059
alpha     1.81      0.23     1.37     2.27 1.00     4531     2851

Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).

In the Population-Level Effects section of Tab. 7 are now two estimates for the skewness parameter alpha (one for the controlled [alpha_Intercept] and one for the normal condition [alpha_condN]), while there is no entry for alpha in the Family Specific section anymore. All this due to our explicit modeling of alpha conditional on instruction condition.

pp_check(m6, nsamples = 100)

Fig. 12. Posterior predictive check. The thick blue line shows the distribution of the empirical data. The thin blue lines are one-hundred realizations of data generated from parameters estimated by the model.


# , fig.width=12
# wrap_plots(plot(conditional_effects(m6),
#              plot = FALSE)) +
#   plot_annotation(tag_levels = "A")
conditional_effects(m6,
                    dpar = "mu")

2.1.7 Group x Condition x ArmVI Model

(m6a_form <-bf(transSC ~ patient * cond * arm +
                 (1 | subj) + 
                 (1 | cond) + 
                 (1 | arm)))
transSC ~ patient * cond * arm + (1 | subj) + (1 | cond) + (1 | arm) 
(m6a_prior <- m6_prior)
        prior class coef group resp dpar nlpar bound source
 normal(0, 3)    sd                                    user
 normal(0, 3) sigma                                    user
 normal(0, 2) alpha                                    user
if (MODEL) {
  m6a <- brm(m6a_form,
             prior = m6a_prior,
             family = skew_normal(),
             inits = "0",
             data = drum_beats)
  m6a <- add_criterion(m6a, 
                       "loo",
                       reloo = TRUE)
  save(m6a, 
       file = "m6a.rda")
} else {
  load("m6a.rda")
}

Tab. 8. Model summary.

(m6a_summary <- summary(m6a, 
                       priors = TRUE))
 Family: skew_normal 
  Links: mu = identity; sigma = identity; alpha = identity 
Formula: transSC ~ patient * cond * arm + (1 | subj) + (1 | cond) + (1 | arm) 
   Data: drum_beats (Number of observations: 1102) 
Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
         total post-warmup samples = 4000

Priors: 
alpha ~ normal(0, 2)
Intercept ~ student_t(3, 735, 136.5)
sd ~ normal(0, 3)
sigma ~ normal(0, 3)

Group-Level Effects: 
~arm (Number of levels: 2) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     2.41      1.80     0.10     6.71 1.00     2833     1943

~cond (Number of levels: 2) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     2.37      1.79     0.10     6.40 1.00     3087     2103

~subj (Number of levels: 8) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)    29.38      1.52    26.52    32.46 1.00     3311     2956

Population-Level Effects: 
                     Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept              784.68     16.25   752.70   816.08 1.00     1414
patient1               -42.46     22.19   -87.54    -0.31 1.00     1516
condN                  -42.49      7.32   -56.89   -27.74 1.00     2531
armND                   -7.44      7.37   -22.23     6.82 1.00     2331
patient1:condN           8.85      8.86    -8.69    25.74 1.00     2429
patient1:armND          26.50      8.62    10.22    43.61 1.00     2276
condN:armND             -0.28      8.44   -17.26    16.42 1.00     2172
patient1:condN:armND   -13.59     12.42   -38.69    10.42 1.00     1939
                     Tail_ESS
Intercept                1835
patient1                 1695
condN                    2984
armND                    2147
patient1:condN           3024
patient1:armND           2639
condN:armND              2740
patient1:condN:armND     2398

Family Specific Parameters: 
      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma    52.16      0.93    50.40    53.98 1.00     5417     2475
alpha     1.68      0.23     1.22     2.15 1.00     5103     2958

Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).

In the Population-Level Effects section of Tab. 8 are now two estimates for the skewness parameter alpha (one for the controlled [alpha_Intercept] and one for the normal condition [alpha_condN]), while there is no entry for alpha in the Family Specific section anymore. All this due to our explicit modeling of alpha conditional on instruction condition.

pp_check(m6a, nsamples = 100)

Fig. 13. Posterior predictive check. The thick blue line shows the distribution of the empirical data. The thin blue lines are one-hundred realizations of data generated from parameters estimated by the model.


# wrap_plots(plot(conditional_effects(m6a),
#                 plot = FALSE)) +
#     plot_annotation(tag_levels = "A")
conditional_effects(m6a,
                    dpar = "mu")

conditions <- make_conditions(drum_beats, 
                              vars = "arm")
conditional_effects(m6a,
                    dpar = "mu",
                    effects = "patient:cond",
                    conditions = conditions)

2.1.8 Modeling Condition-specific Variation

As is apparent from Fig. 1, the controlled condition yielded broader density distributions in most descriptors. Hence, we model condition-dependent variation in the next model:

(m7_form <-bf(transSC ~ patient * cond * arm + 
                (1 | subj) + 
                (1 | cond) +
                (1 | arm),
              sigma ~ cond))
transSC ~ patient * cond * arm + (1 | subj) + (1 | cond) + (1 | arm) 
sigma ~ cond

This model has now two outcomes, not just one, as the models before. Spread is estimated as sigma, and it varies conditional on instruction condition.

Here’s the non-standard (additional) prior:

(m7_prior <- c(set_prior("normal(0, 3)", class = "sd"),
               set_prior("normal(0, 2)", class = "alpha"),
               set_prior("normal(0, 2)", class = "Intercept", dpar = "sigma"),
               set_prior("normal(0, 2)", class = "b",         dpar = "sigma")))
        prior     class coef group resp  dpar nlpar bound source
 normal(0, 3)        sd                                     user
 normal(0, 2)     alpha                                     user
 normal(0, 2) Intercept                 sigma               user
 normal(0, 2)         b                 sigma               user
if (MODEL) {
  m7 <- brm(m7_form,
            prior = m7_prior,
            family = skew_normal(),
            inits = "0",
            data = drum_beats)
  m7 <- add_criterion(m7, 
                      "loo",
                      reloo = TRUE)
  save(m7, 
       file = "m7.rda")
} else {
  load("m7.rda")
}

Tab. 9. Model summary.

(m7_summary <- summary(m7, 
                       priors = TRUE))
 Family: skew_normal 
  Links: mu = identity; sigma = log; alpha = identity 
Formula: transSC ~ patient * cond * arm + (1 | subj) + (1 | cond) + (1 | arm) 
         sigma ~ cond
   Data: drum_beats (Number of observations: 1102) 
Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
         total post-warmup samples = 4000

Priors: 
alpha ~ normal(0, 2)
b_sigma ~ normal(0, 2)
Intercept ~ student_t(3, 735, 136.5)
Intercept_sigma ~ normal(0, 2)
sd ~ normal(0, 3)

Group-Level Effects: 
~arm (Number of levels: 2) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     2.45      1.80     0.12     6.73 1.00     2826     1904

~cond (Number of levels: 2) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     2.40      1.85     0.07     6.88 1.00     2557     1553

~subj (Number of levels: 8) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)    27.46      1.53    24.64    30.52 1.00     3047     2515

Population-Level Effects: 
                     Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept              788.64     15.37   758.66   820.26 1.00     1626
sigma_Intercept          4.31      0.04     4.24     4.38 1.00     4379
patient1               -40.66     21.16   -83.49     0.07 1.00     1799
condN                  -45.99      8.09   -62.39   -30.16 1.00     2715
armND                   -9.94      9.21   -28.35     8.70 1.00     2681
patient1:condN           7.82     10.10   -12.30    27.96 1.00     2447
patient1:armND          24.34     11.79     0.81    47.67 1.00     2387
condN:armND              0.73      9.59   -19.08    19.06 1.00     2633
patient1:condN:armND   -10.03     13.79   -37.37    17.72 1.00     2142
sigma_condN             -0.47      0.06    -0.58    -0.36 1.00     4162
                     Tail_ESS
Intercept                1847
sigma_Intercept          2718
patient1                 2170
condN                    2750
armND                    2431
patient1:condN           2364
patient1:armND           2629
condN:armND              2686
patient1:condN:armND     2184
sigma_condN              2700

Family Specific Parameters: 
      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
alpha     2.38      0.30     1.82     3.00 1.00     4237     2986

Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
conditions <- make_conditions(drum_beats, 
                              vars = "arm")
conditional_effects(m7,
                    dpar = "mu",
                    effects = "patient:cond",
                    conditions = conditions)

In the Links section of the summary (Tab. 9) we note that sigma is no longer modeled on the identity scale but on the \(\log_{2}\) scale. In the Population-Level Effects section of Tab. 9 we now find not only the estimates for the Intercept and condN but also two estimates for sigma (one for the controlled [sigma_Intercept] and one for the normal condition [sigma_condN]). Because of this, there is no entry for sigma in the Family Specific section anymore. All this due to our explicit modeling of sigma conditional on instruction condition.

pp_check(m7, nsamples = 100)

Fig. 14. Posterior predictive check. The thick blue line shows the distribution of the empirical data. The thin blue lines are one-hundred realizations of data generated from parameters estimated by the model.


# , fig.width=12, fig.height=8
# p <- plot(conditional_effects(m7,
#                               dpar = "mu"),
#           plot = FALSE)
# p1 <- wrap_plots(p[[1]]+
#                    p[[2]] +
#                    p[[3]])
# p <- plot(conditional_effects(m7,
#                               dpar = "sigma"),
#           plot = FALSE)
# p2 <- wrap_plots(p[[1]]+
#                    p[[2]] +
#                    p[[3]])
# wrap_plots(p1, p2,
#            ncol = 1) +
#   plot_annotation(tag_levels = "A")
conditional_effects(m7,
                    dpar = "mu")

conditional_effects(m7,
                    dpar = "sigma")

Fig. 15. Conditional plot.


In Fig. 15 we see a difference between the mean (‘mu’) estimated value for transSC depending on instruction condition (A), but no difference between dominant and non-dominant arm (B). Consequently, there is no interaction in (C).

The spread (sigma) of the estimated distributions also differs between conditions (D), but again not between arms (E). The latter is not surprising because we modeled sigma to vary conditional on condition, not arm.

2.1.9 Modeling Arm-specific Skewness

At least in some descriptors in Fig. 1 the skewness of the distribution seems to change depending on the arm. The skew normal distribution is a generalization of the Gaussian distribution, allowing for the additional shape-parameter skewness (asymmetry) to vary. Hence, we model this side-dependent skewness in the next model:

(m8_form <-bf(transSC ~ patient * cond * arm + 
                (1 | subj) + 
                (1 | cond) +
                (1 | arm),
              sigma ~ cond,
              alpha ~ arm))
transSC ~ patient * cond * arm + (1 | subj) + (1 | cond) + (1 | arm) 
sigma ~ cond
alpha ~ arm
(m8_prior <- c(set_prior("normal(0, 3)", class = "sd"),
               set_prior("normal(0, 2)", class = "Intercept", dpar = "sigma"),
               set_prior("normal(0, 2)", class = "b",         dpar = "sigma"),
               set_prior("normal(0, 2)", class = "Intercept", dpar = "alpha"),
               set_prior("normal(0, 2)", class = "b",         dpar = "alpha")))
        prior     class coef group resp  dpar nlpar bound source
 normal(0, 3)        sd                                     user
 normal(0, 2) Intercept                 sigma               user
 normal(0, 2)         b                 sigma               user
 normal(0, 2) Intercept                 alpha               user
 normal(0, 2)         b                 alpha               user
if (MODEL) {
  m8 <- brm(m8_form,
            prior = m8_prior,
            family = skew_normal(),
            inits = "0",
            data = drum_beats)
  m8 <- add_criterion(m8, 
                      "loo",
                      reloo = TRUE)
  save(m8, 
       file = "m8.rda")
} else {
  load("m8.rda")
}

Tab. 10. Model summary.

(m8_summary <- summary(m8, 
                       priors = TRUE))
 Family: skew_normal 
  Links: mu = identity; sigma = log; alpha = identity 
Formula: transSC ~ patient * cond * arm + (1 | subj) + (1 | cond) + (1 | arm) 
         sigma ~ cond
         alpha ~ arm
   Data: drum_beats (Number of observations: 1102) 
Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
         total post-warmup samples = 4000

Priors: 
b_alpha ~ normal(0, 2)
b_sigma ~ normal(0, 2)
Intercept ~ student_t(3, 735, 136.5)
Intercept_alpha ~ normal(0, 2)
Intercept_sigma ~ normal(0, 2)
sd ~ normal(0, 3)

Group-Level Effects: 
~arm (Number of levels: 2) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     2.38      1.87     0.07     6.98 1.00     2987     1790

~cond (Number of levels: 2) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     2.38      1.80     0.09     6.68 1.00     3306     1735

~subj (Number of levels: 8) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)    27.37      1.50    24.51    30.49 1.00     3406     2864

Population-Level Effects: 
                     Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept              788.43     15.72   757.46   819.13 1.01     1715
sigma_Intercept          4.33      0.04     4.26     4.40 1.00     4720
alpha_Intercept          1.69      0.39     0.91     2.39 1.00     4219
patient1               -44.08     21.66   -86.73    -2.51 1.00     1883
condN                  -44.83      8.10   -60.89   -28.83 1.00     2201
armND                   -9.85      9.11   -27.84     8.10 1.00     2258
patient1:condN           9.97     10.41   -10.35    29.86 1.00     2225
patient1:armND          27.96     11.89     4.74    51.28 1.00     2048
condN:armND             -1.15      9.56   -19.46    17.55 1.00     2228
patient1:condN:armND   -10.74     13.81   -37.69    15.33 1.00     1846
sigma_condN             -0.51      0.06    -0.62    -0.40 1.00     4662
alpha_armND              1.66      0.54     0.65     2.77 1.00     3523
                     Tail_ESS
Intercept                2205
sigma_Intercept          2846
alpha_Intercept          2289
patient1                 2323
condN                    2530
armND                    2833
patient1:condN           3024
patient1:armND           2768
condN:armND              2745
patient1:condN:armND     2541
sigma_condN              2773
alpha_armND              2326

Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).

In the Population-Level Effects section of Tab. 10 are now two estimates for the skewness parameter alpha (one for the dominant [alpha_Intercept] and one for the non-dominant arm [alpha_armND]), while there is no entry for alpha in the Family Specific section anymore. All this due to our explicit modeling of alpha conditional on arm.

pp_check(m8, nsamples = 100)

Fig. 16. Posterior predictive check. The thick blue line shows the distribution of the empirical data. The thin blue lines are one-hundred realizations of data generated from parameters estimated by the model.


# , fig.width=12, fig.height=12
# p <- plot(conditional_effects(m8,
#                               dpar = "mu"),
#           plot = FALSE)
# p1 <- wrap_plots(p[[1]] + xlab("") +
#                    p[[2]] + xlab("") + ylab("") +
#                    p[[3]] + xlab("") + ylab("") + theme(legend.position = "none"))
# p <- plot(conditional_effects(m8,
#                               dpar = "alpha"),
#           plot = FALSE)
# p2 <- wrap_plots(p[[1]] + xlab("") +
#                    p[[2]] + xlab("") + ylab("") +
#                    p[[3]] + xlab("") + ylab("") + theme(legend.position = "none"))
# p <- plot(conditional_effects(m8,
#                               dpar = "sigma"),
#           plot = FALSE)
# p3 <- wrap_plots(p[[1]] +
#                    p[[2]] + ylab("") +
#                    p[[3]] + ylab("") + theme(legend.position = "bottom"))
# wrap_plots(p1, p2, p3, 
#            ncol = 1) +
#   plot_annotation(tag_levels = "A")
conditional_effects(m8,
                    dpar = "mu")

conditions <- make_conditions(drum_beats, 
                              vars = "arm")
conditional_effects(m8,
                    dpar = "mu",
                    effects = "patient:cond",
                    conditions = conditions)

conditional_effects(m8,
                    dpar = "sigma")

conditional_effects(m8,
                    dpar = "sigma",
                    effects = "patient:cond",
                    conditions = conditions)

conditional_effects(m8,
                    dpar = "alpha")

conditional_effects(m8,
                    dpar = "alpha",
                    effects = "patient:cond",
                    conditions = conditions)

Fig. 17. Conditional plots.


In Fig. 17 there is a clear difference in estimated mean (‘mu’) of \(transSC\) conditional on instruction (A), but not on arm (B). Consequently, there is no interaction between instruction and arm (C). On the other hand, there is a difference in estimated skewness (‘alpha’) between sides (E), but not instructions (D). (F) follows from that. ‘sigma’ shows a clear difference between instructions (G), not so for side (H), which is mirrored in (I).

2.1.10 Modeling Influence of Instruction and Arm on Shape

To be able to see whether skewness and spread are depending on both experimental manipulation and arm, the model formulas for ‘sigma’ and ‘alpha’ are updated accordingly:

(m9_form <-bf(transSC ~ patient * cond * arm + 
                (1 | subj) + 
                (1 | cond) +
                (1 | arm),
              sigma ~ cond + arm,
              alpha ~ arm + cond))
transSC ~ patient * cond * arm + (1 | subj) + (1 | cond) + (1 | arm) 
sigma ~ cond + arm
alpha ~ arm + cond
(m9_prior <- m8_prior)
        prior     class coef group resp  dpar nlpar bound source
 normal(0, 3)        sd                                     user
 normal(0, 2) Intercept                 sigma               user
 normal(0, 2)         b                 sigma               user
 normal(0, 2) Intercept                 alpha               user
 normal(0, 2)         b                 alpha               user
if (MODEL) {
  m9 <- brm(m9_form,
            prior = m9_prior,
            family = skew_normal(),
            inits = "0",
            data = drum_beats)
  m9 <- add_criterion(m9, 
                      "loo",
                      reloo = TRUE)
  save(m9, 
       file = "m9.rda")
} else {
  load("m9.rda")
}

Tab. 11. Model summary.

(m9_summary <- summary(m9, 
                       priors = TRUE))
 Family: skew_normal 
  Links: mu = identity; sigma = log; alpha = identity 
Formula: transSC ~ patient * cond * arm + (1 | subj) + (1 | cond) + (1 | arm) 
         sigma ~ cond + arm
         alpha ~ arm + cond
   Data: drum_beats (Number of observations: 1102) 
Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
         total post-warmup samples = 4000

Priors: 
b_alpha ~ normal(0, 2)
b_sigma ~ normal(0, 2)
Intercept ~ student_t(3, 735, 136.5)
Intercept_alpha ~ normal(0, 2)
Intercept_sigma ~ normal(0, 2)
sd ~ normal(0, 3)

Group-Level Effects: 
~arm (Number of levels: 2) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     2.41      1.85     0.08     6.94 1.00     2766     1880

~cond (Number of levels: 2) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     2.42      1.83     0.09     6.68 1.00     3052     1933

~subj (Number of levels: 8) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)    27.31      1.56    24.34    30.47 1.00     3427     2718

Population-Level Effects: 
                     Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept              790.22     15.43   760.75   820.26 1.00     2075
sigma_Intercept          4.34      0.05     4.25     4.43 1.00     4088
alpha_Intercept          4.41      0.67     3.19     5.80 1.00     3092
patient1               -37.78     20.52   -77.33     3.01 1.00     1828
condN                  -46.55      7.83   -61.78   -31.03 1.00     2564
armND                  -16.22      8.93   -33.98     1.76 1.00     2442
patient1:condN           2.47      9.10   -15.49    20.02 1.00     2684
patient1:armND          33.35     10.63    12.48    54.34 1.00     2089
condN:armND              4.68      9.10   -13.49    23.03 1.00     2469
patient1:condN:armND   -16.44     12.55   -41.73     8.12 1.00     1933
sigma_condN             -0.62      0.05    -0.72    -0.51 1.00     4354
sigma_armND              0.05      0.05    -0.05     0.16 1.00     4138
alpha_armND              2.62      0.80     1.17     4.07 1.00     1504
alpha_condN             -4.83      0.81    -6.40    -3.29 1.00     1491
                     Tail_ESS
Intercept                2317
sigma_Intercept          2960
alpha_Intercept          3240
patient1                 2190
condN                    2185
armND                    2653
patient1:condN           2917
patient1:armND           2970
condN:armND              2753
patient1:condN:armND     2630
sigma_condN              2987
sigma_armND              2801
alpha_armND              3454
alpha_condN              2538

Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).

In the Population-Level Effects section of Tab. 11 are now three estimates for the skewness parameter alpha, as well as three estimates for spread (‘sigma’).

pp_check(m9, nsamples = 100)

Fig. 18. Posterior predictive check. The thick blue line shows the distribution of the empirical data. The thin blue lines are one-hundred realizations of data generated from parameters estimated by the model.


# , fig.width=12, fig.height=12
# p <- plot(conditional_effects(m9, 
#                               dpar = "mu"),
#           plot = FALSE)
# p1 <- wrap_plots(p[[1]] + xlab("") +
#                    p[[2]] + xlab("") + ylab("") +
#                    p[[3]] + xlab("") + ylab("") +
#                    p[[4]] + xlab("") + ylab("") + theme(legend.position = "none") +
#                    p[[5]] + xlab("") + ylab("") + theme(legend.position = "none") +
#                    p[[6]] + xlab("") + ylab("") + theme(legend.position = "none"))
# p <- plot(conditional_effects(m9,
#                               dpar = "alpha"),
#           plot = FALSE)
# p2 <- wrap_plots(p[[1]] + xlab("") +
#                    p[[2]] + xlab("") + ylab("") +
#                    p[[3]] + xlab("") + ylab("") +
#                    p[[4]] + xlab("") + ylab("") + theme(legend.position = "none") +
#                    p[[5]] + xlab("") + ylab("") + theme(legend.position = "none") +
#                    p[[6]] + xlab("") + ylab("") + theme(legend.position = "none"))
# p <- plot(conditional_effects(m9,
#                               dpar = "sigma"),
#           plot = FALSE)
# p3 <- wrap_plots(p[[1]] +
#                    p[[2]] + ylab("") +
#                    p[[3]] + ylab("") +
#                    p[[4]] + ylab("") + theme(legend.position = "bottom") +
#                    p[[5]] + ylab("") + theme(legend.position = "bottom") +
#                    p[[6]] + ylab("") + theme(legend.position = "bottom"))
# wrap_plots(p1, p2, p3) +
#   plot_annotation(tag_levels = "A")
conditional_effects(m9,
                    dpar = "mu")

conditions <- make_conditions(drum_beats, 
                              vars = "arm")
conditional_effects(m9,
                    dpar = "mu",
                    effects = "patient:cond",
                    conditions = conditions)

conditional_effects(m9,
                    dpar = "sigma")

conditional_effects(m9,
                    dpar = "sigma",
                    effects = "patient:cond",
                    conditions = conditions)

conditional_effects(m9,
                    dpar = "alpha")

conditional_effects(m9,
                    dpar = "alpha",
                    effects = "patient:cond",
                    conditions = conditions)

Fig. 19. Conditional plots.


In Fig. 19 there is a clear difference in estimated mean (‘mu’) of \(transSC\) conditional on instruction (A), but not on arm (B). Consequently, there is no interaction between instruction and arm (C). There is a difference in estimated skewness (‘alpha’) both between instructions (D) and sides (E), but with opposing trends. Nevertheless, there is no interaction between them (F). ‘sigma’ shows a clear difference between instructions (G) as well as for side (H), but albeit their opposing trends, there is no interaction (I).

2.1.11 Model Comparison

We compare models by their estimated log-posterior density (elpd). The smaller this value the better a model predicts the data, despite the penalty for additional covariates. When the difference between two models is more than two SE apart they are considered to be ‘different enough’ to warrant acceptance of one over the other despite possibly smaller parsimony.

loo_compare(m0, m2, m3, m5, m6, m6a, m7, m8, m9)
    elpd_diff se_diff
m9     0.0       0.0 
m8   -38.3       7.9 
m7   -42.9       8.9 
m6a  -80.6      15.8 
m2   -81.2      16.7 
m3   -81.4      16.7 
m5   -83.2      16.9 
m6   -83.5      16.9 
m0  -120.0      14.9 

The model with the smallest elpd is m9, which corresponds to the last model.

2.1.12 Conclusion

Each row of the plot in Fig. 19 represents the results of one of the three outcomes, each column shows the estimates for one condition/manipulation. The dots in these plots are the means of the posterior distributions of the respective estimate, and can be interpreted similarly to the point estimates in traditional frequentist statistics. The error bars represent 95% credible intervals, which are interpreted as comprising the true value with 95% probability, given the model and the data.

From the first row of Fig. 19 we can infer that instructions had an effect on the mean, while arm had not. The second row suggests that instruction had a larger, and opposing, effect on skewness compared to arm arm, and finally, the third row claims the same for spread.

On a different level of understanding these results this means that transSC is lower in the normal strokes, with almost no skewness (alpha is close to zero) and lower spread than in controlled strokes.

Based on the above we can infer that instruction causes the most pronounced differences in transSC, while the playing arm only seems to invoke minor to no differences.

2.2 Adding the Response transFlat

In the following, the descriptor transFlat is added as an outcome to our model. Technically speaking, we would need to re-start our modeling attempt with the Null model and work our way up to the ‘best’ model as we have done with transSC. This is necessary because we cannot just assume that with an additional outcome (which will actually become three additional outcomes: mu, alpha and sigma) will be best explained by the same model as was with just one outcome variable.

But we take a short cut here and just add transFlat to the best model of transSC.

To be able to see whether skewness and spread are depending on both experimental manipulation and arm, the model formulas for ‘sigma’ and ‘alpha’ are updated accordingly:

(m10_form <-bf(mvbind(transSC, transFlat) ~ cond + arm + 
                 (1|p|cond) +
                 (1|q|arm) + 
                 (1|r|subj),
               sigma ~ cond + arm,
               alpha ~ arm + cond))
transSC ~ cond + arm + (1 | p | cond) + (1 | q | arm) + (1 | r | subj) 
sigma ~ cond + arm
alpha ~ arm + cond
transFlat ~ cond + arm + (1 | p | cond) + (1 | q | arm) + (1 | r | subj) 
sigma ~ cond + arm
alpha ~ arm + cond

The prior probability on the individual intercepts needs to reflect that there are now two response variables:

(m10_prior <- c(
  set_prior("lkj(2)",         class = "cor"),
  
  set_prior("normal(0, 0.1)", class = "sd",        resp = "transFlat"),
  set_prior("normal(0, 2)",   class = "b",         resp = "transFlat", dpar = "alpha"),
  set_prior("normal(0, 2)",   class = "Intercept", resp = "transFlat", dpar = "alpha"),
  set_prior("normal(0, 1)",   class = "Intercept", resp = "transFlat", dpar = "sigma"),
  set_prior("normal(0, 1)",   class = "b",         resp = "transFlat", dpar = "sigma"),
  
  set_prior("normal(0, 0.1)", class = "sd",        resp = "transSC"),
  set_prior("normal(0, 2)",   class = "b",         resp = "transSC",   dpar = "alpha"),
  set_prior("normal(0, 2)",   class = "Intercept", resp = "transSC",   dpar = "alpha"),
  set_prior("normal(0, 2)",   class = "Intercept", resp = "transSC",   dpar = "sigma"),
  set_prior("normal(0, 2)",   class = "b",         resp = "transSC",   dpar = "sigma")
))
          prior     class coef group      resp  dpar nlpar bound source
         lkj(2)       cor                                          user
 normal(0, 0.1)        sd            transFlat                     user
   normal(0, 2)         b            transFlat alpha               user
   normal(0, 2) Intercept            transFlat alpha               user
   normal(0, 1) Intercept            transFlat sigma               user
   normal(0, 1)         b            transFlat sigma               user
 normal(0, 0.1)        sd              transSC                     user
   normal(0, 2)         b              transSC alpha               user
   normal(0, 2) Intercept              transSC alpha               user
   normal(0, 2) Intercept              transSC sigma               user
   normal(0, 2)         b              transSC sigma               user
if (MODEL) {
  t <- Sys.time()
  m10 <- brm(m10_form,            
            prior = m10_prior,
            family = skew_normal(),
            data = drum_beats,
            inits = "0")
  print(Sys.time() - t)
  m10 <- add_criterion(m10, 
                      "loo",
                      reloo = TRUE)
  save(m10, 
       file = "m10.rda")
} else {
  # load("m10.rda")
}
NULL

Tab. 12. Model summary.

# (m10_summary <- summary(m10, 
#                        priors = TRUE))

In the Population-Level Effects section of Tab. 12 are now three estimates for the skewness parameter alpha, as well as three estimates for spread (‘sigma’).

# pp_check(m10, resp = "transSC", nsamples = 100)
# pp_check(m10, resp = "transFlat", nsamples = 100)

Fig. 20. Posterior predictive check. The thick blue line shows the distribution of the empirical data. The thin blue lines are one-hundred realizations of data generated from parameters estimated by the model.


# , fig.width=12, fig.height=12
# p <- plot(conditional_effects(m10,
#                               dpar = "mu"),
#           plot = FALSE)
# p1 <- wrap_plots(p[[1]] + xlab("") +
#                    p[[2]] + xlab("") + ylab("") +
#                    p[[3]] + xlab("") + ylab("") + theme(legend.position = "none"))
# p <- plot(conditional_effects(m10,
#                               dpar = "alpha"),
#           plot = FALSE)
# p2 <- wrap_plots(p[[1]] + xlab("") +
#                    p[[2]] + xlab("") + ylab("") +
#                    p[[3]] + xlab("") + ylab("") + theme(legend.position = "none"))
# p <- plot(conditional_effects(m10,
#                               dpar = "sigma"),
#           plot = FALSE)
# p3 <- wrap_plots(p[[1]] +
#                    p[[2]] + ylab("") +
#                    p[[3]] + ylab("") + theme(legend.position = "bottom"))
# wrap_plots(p1, p2, p3, 
#            ncol = 1) +
#   plot_annotation(tag_levels = "A")

Fig. 21. Conditional plots.


In Fig. 21 there is a clear difference in estimated mean (‘mu’) of \(transSC\) conditional on instruction (A), but not on arm (B). Consequently, there is no interaction between instruction and arm (C). There is a difference in estimated skewness (‘alpha’) both between instructions (D) and sides (E), but with opposing trends. Nevertheless, there is no interaction between them (F). ‘sigma’ shows a clear difference between instructions (G) as well as for side (H), but albeit their opposing trends, there is no interaction (I).

2.3 transCrest

3 System Setup

Data wrangling and analyses were carried out with the statistical package R (R version 4.0.2 (2020-06-22); R Core Team 2020). Bayesian modeling was done with the package brms (Bürkner 2017, 2018) which uses the probabilistic language Stan as back end (Carpenter et al. 2017). Plots were done with the packages bayesplot (Gabry and Mahr 2020) and ggplot2 (???).

References

Bates, D. M. 2010. Lme4: Mixed-Effects Modeling with R. Springer. http://lme4.r-forge.r-project.org/lMMwR/lrgprt.pdf.

Bürkner, Paul-Christian. 2017. “Brms: An R Package for Bayesian Multilevel Models Using Stan.” Journal of Statistical Software 80 (1). https://doi.org/10.18637/jss.v080.i01.

———. 2018. “Advanced Bayesian Multilevel Modeling with the R Package Brms.” The R Journal 10 (1).

Carpenter, Bob, Andrew Gelman, Matthew Hoffman, Daniel Lee, Ben Goodrich, Michael Betancourt, Marcus Brubaker, Jiqiang Guo, Peter Li, and Allen Riddell. 2017. “Stan: A Probabilistic Programming Language.” Journal of Statistical Software, Articles 76 (1): 1–32. https://doi.org/10.18637/jss.v076.i01.

Câmara, Guilherme Schmidt, Kristian Nymoen, Olivier Lartillot, and Anne Danielsen. 2020. “Effects of Instructed Timing on Electric Guitar and Bass Sound in Groove Performance.” The Journal of the Acoustical Society of America 147 (2): 1028–41. https://doi.org/10.1121/10.0000724.

Danielsen, Anne, Carl Haakon Waadeland, Henrik G. Sundt, and Maria A. G. Witek. 2015. “Effects of Instructed Timing and Tempo on Snare Drum Sound in Drum Kit Performance.” The Journal of the Acoustical Society of America 138 (4): 2301–16. https://doi.org/10.1121/1.4930950.

Gabry, Jonah, and Tristan Mahr. 2020. “Bayesplot: Plotting for Bayesian Models.” https://mc-stan.org/bayesplot.

R Core Team. 2020. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.

Tibshirani, Robert. 1996. “Regression Shrinkage and Selection via the Lasso.” Journal of the Royal Statistical Society: Series B (Methodological) 58 (1): 267–88. https://doi.org/10.1111/j.2517-6161.1996.tb02080.x.

Wilkinson, G. N., and C. E. Rogers. 1973. “Symbolic Description of Factorial Models for Analysis of Variance.” Applied Statistics 22 (3): 392–99. https://doi.org/10.2307/2346786.